<div class="authorization-form">
	<h3 class="popup-title">Авторизация на сайте</h3>
	<div class="authorization-form__inner">
		<?php
		$form = $this->beginWidget('CActiveForm', array(
			'id' => 'login-form',
			'action' => '/main/ajax/login',
			'enableAjaxValidation' => true,
			'clientOptions' => array(
				'validateOnSubmit' => true,
			),
		));
		?>
		<div style="display: none">
			<?php echo $form->error($model, 'username'); ?>
			<?php echo $form->error($model, 'password'); ?>
		</div>
		<fieldset>
			<div class="type-text">
				<?php echo $form->textField($model, 'username', array('placeholder' => 'Логин')); ?>				
			</div>
		</fieldset>
		<fieldset>
			<div class="type-text">
				<?php echo $form->passwordField($model, 'password', array('placeholder' => 'Пароль')); ?>					
			</div>
		</fieldset>
		<fieldset>
			<div class="authorization-form__left">
				<div class="checkbox">
					<?php echo $form->checkBox($model, 'rememberMe', array('id' => 'remember')); ?>					
					<label for="remember">
						<span class="checkbox__box">
							<span class="checkbox__box__inner">&nbsp;</span>
						</span>    
						<span class="checkbox__text">Запомнить</span>
					</label>
				</div>
				<a href="/main/ajax/loadForm?formName=forgotPassword&modelName=ForgotPasswordForm" class="fancybox fancybox.ajax authorization-form__link">Я забыл пароль</a>
			</div>
			<div class="authorization-form__right">
				<div class="type-submit">
					<?php echo CHtml::submitButton('Войти'); ?>					
				</div> 
			</div>
		</fieldset>
		<?php $this->endWidget(); ?>
	</div>
	
</div>
<script type="text/javascript">
	/*&lt;![CDATA[*/
	jQuery('#login-form').yiiactiveform({'validateOnSubmit': true, 'attributes': [{'id': 'LoginForm_username', 'inputID': 'LoginForm_username', 'errorID': 'LoginForm_username_em_', 'model': 'LoginForm', 'name': 'username', 'enableAjaxValidation': true}, {'id': 'LoginForm_password', 'inputID': 'LoginForm_password', 'errorID': 'LoginForm_password_em_', 'model': 'LoginForm', 'name': 'password', 'enableAjaxValidation': true}], 'errorCss': 'error'});

	$(document).ready(function() {
		$("#social-net").html($("#uLogin").clone());		
		$("#social-net div").css('display', 'block');		
		$('#login-form').attr('action', '/main/ajax/login?return=' + window.location.pathname);
	});
	/*]]&gt;*/
</script>